#ifndef __HDR_GLOBALS_HPP__
#define __HDR_GLOBALS_HPP__

#include <vector>
#include <GL/glut.h>
#include "Mathematics/MMatrix4.hpp"
#include "LookAtMatrix.hpp"

using namespace std;

enum SpecialTexture
{
	LIGHT_POSITIONS,
	SHADOW_MAP
};

enum LightMatrix
{
	MODELVIEW_MATRIX,
	PROJECTION_MATRIX
};

typedef vector<LookAtMatrix*> mvMatricesVec;

class Globals
{
public:
	static Globals* GetInstance();
	
	void            SetSpecialTexture( GLuint lTex, SpecialTexture type );
	GLuint*         GetSpecialTexture( SpecialTexture type );

	GLdouble*    	GetLightMatrix( LightMatrix matrix );
	GLdouble*    	GetCameraMatrix( LightMatrix matrix );

	void            SetCameraMatrix( LightMatrix matrix, MMatrix4 &mData );
	void            SetLightMatrix( LightMatrix matrix, MMatrix4 &mData );

	mvMatricesVec   GetLookAtMaticesVector();
	void            AddLookAtMatrix( LookAtMatrix* newMatrix );

private:
	Globals();

	static Globals*   m_instance;

	GLuint                  m_lightTex;
	GLuint                  m_shadowMap;
	GLdouble*               m_lightModelViewMatrix;
	GLdouble*               m_lightProjectionMatrix;

	GLdouble*               m_cameraProjectionMatrix;
	GLdouble*               m_cameraModelViewMatrix;

	mvMatricesVec           m_lookAtMatrices;
};

#endif // __HDR_GLOBALS_HPP__